#!/bin/bash

#=======================================================================
# git-delrembr
# File ID: bb8f9564-dfd3-11e2-b044-0800274013ad
# Delete the specified Git branches locally and from all remotes
# License: GNU General Public License version 2 or later.
#=======================================================================

progname=git-delrembr

if test "$1" = "-h" -o "$1" = "--help"; then
    echo Syntax: $progname ref [...]
    exit 0
fi

branches="$@"
remotes=". $(git remote)"
for r in $remotes; do
    echo
    echo ==== remote \"$r\" ====
    for b in $branches; do
        git push $r :$b
    done
done
